<?php
declare (strict_types = 1);

namespace app\api\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class MissionSchedule extends Model
{


    protected $json = ['others'];
    protected $jsonAssoc = true;

  

    /**
     * 获取文件
     * @return [type] [description]
     */
    public function attach(){
        return $this->hasOne("attach",'attach_id',"attach_id")->bind(["file_name","file_path"]);
    }

   public function userInfo(){
    	return $this->hasone("user",'u_id',"u_id");
    }


     public function getContentAttr($value,$row){
      return htmlspecialchars_decode($value);
    }

    


    /**
     * 获取全部状态
     * @var [type]
     */
    public static function  getStatus($int=0){
    	$res =  [     
    		1=>__('submission'),    		 
            2=>__('accepted'),            
    		3=>__('qualified'),    		 
    	];
    	return $int>0 ? $res[$int]:$res;
    }
}
